package com.dt76.smallloanbackenduser.controller.zjs;
import com.dt76.smallloanbackenduser.remote.zjs.MemberRemote;
import com.dt76.smallloanbackenduser.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


@Controller
@RequestMapping("/zjs")
public class MemberController {

    @Autowired
    private MemberRemote memberRemote;

    @RequestMapping("/member")

    public String qryAllMember(Model model,
                               @RequestParam(defaultValue = "1")Integer currentPageNo){


        if (currentPageNo<=0){
            currentPageNo=1;
        }
        Page page = memberRemote.qryAllMember(currentPageNo);

        model.addAttribute("qryMemberList",page.getRows());
        model.addAttribute("page", page);
        System.out.println("調用遠程服務成功");
        return "pages/zjs/topMember";
    }







}
